Date: Mon, 02 Dec 1996 15:06:16 GMT
Server: NCSA/1.4.2
Content-type: text/html

<title>Assignment 1</title>

<h1>Assignment 1 -- Getting Started</h1>

<h2>Due Thursday April 11.</h2>


This assignment is intended to (re)familiarize you with programming in C 
and UNIX.  It should also serve to convince you that kernel operations are
expensive, and that reducing or eliminating such operations might greatly 
improve program performance.
<p>
Please note that this is an individual assignment. You should do your
own measurements and turn in your own results, although this certainly
doesn't mean that you cannot discuss with others what you are doing.
In the project, you may work in groups of two or three.

<ol>
<li> <b>Timing simple UNIX system calls.</b><p>

We mentioned in class that system calls take much more time than regular 
procedure calls.  Show that this is the case by timing how long system 
calls take to execute as opposed to procedure calls.  You will need to use
the standard UNIX timing facility gettimeofday().  The UNIX timer only has
a granularity of about 10ms, so you will need to execute each timed operation
a large number of times in order to get accurate results.  The system call 
getpid() is extremely simple, and so would be a good candidate for measurement.
Remember to factor out any timing overhead that you may introduce.

<p>
<li> <b>UNIX Processes.</b><p>

Use the timing mechanism that you built for part 1 to time how long it takes 
for create and destroy a UNIX process using the fork(), exit() system calls.
</ol>

<h3> Turning in</h3>
You should turn in 
<ul>
<li> your timing code
<li> the results
<li> a description of the computer on which they were gathered
</ul>

<p>


You might find the following man pages helpful: 
<ul>
 <li> gettimeofday
 <li> getpid
 <li> fork
 <li> exit
 <li>  ps
</ul>
